#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main()
{
    int a = 0;
    int b = 0;
    int sum = 0;
    int count = 0;

    scanf("%d %d", &a, &b);
    for (int i = a; i <= b; i++)
    {
        sum += i;
        count++;
        printf("%5d", i);
        if (count == 5)
        {
            printf("\n");
            count = 0;
        }
    }
    printf("\n");
    printf("sum = %d", sum);
    return 0;
}